﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace com.huigo.Framework.ServiceUtils
{
    public class Dict
    {
        public enum ERequestFunc
        {
            DO_USER_LOGIN = 1,
            GET_INS_COMPANY_DROPLIST,
            GET_INS_TYPE_DROPLIST,
            GET_SUP_DROPLIST,
            ADD_PRODUCT,
            GET_PRODUCT_LIST,
            GET_PRODUCT_BY_ID,
            UPDATE_PRODUCT,
            ADD_SUP,
            GET_SUP_LIST,
            GET_SUP_BY_ID,
            UPDATE_SUP,
            ADD_CUST,
            GET_CUST_LIST,
            GET_CUST_BY_ID,
            GET_CUSTEXT_BY_ID,
            UPDATE_CUSTEXT,
            GET_USER_DROPLIST,
            GET_CUST_LEVEL_DROPLIST,
            GET_CUST_TYPE_DROPLIST,
            CUST_IS_EXISTED,
            UPDATE_CUST,
            UPDATE_CUST_INFO,
            GET_INS_COMPANY,
            ADD_INS_COMPANY,
            GET_INS_CONPANY_BY_ID,
            GET_INS_COMPANY_LIST,
            UPDATE_INS_COMPANY,
            GET_USER_INFO,
            ADD_USER_INFO,
            UPDATE_USER_INFO,
            GET_USER_INFO_LIST,
            GET_USER_ROSE_LIST,
            GET_USER_DEPT_LIST,
            GET_USER_INFO_BY_ID,
            GET_ORDER_INFO,
            GET_ORDER_INFO_BY_ID,
            GET_POLICY_INFO_AIR_LIST,
            GET_POLICY_INFO_TRAVEL_LIST,
            GET_ORDER_FLOW_LIST,
            GET_POLICY_FLOW_LIST,
            GET_POLICY_INFO_AIR_BY_ID,
            POLICY_INFO_AIR_IS_EXISTED,
            ORDER_INFO_IS_EXISTED,
            UPDATE_ORDER_INFO_STATUS,
            UPDATE_POLICY_INFO_AIR_STATUS,
            UPDATE_USER_INFO_LAST_TIME,
            GET_INVOICE_ORDER_INFO,
            GET_INVOICE_ORDER_FLOW_LIST,
            GET_PRODUCT_LIST_NAME,
            UPDATE_INVOICE_ORDER,
            GET_INVOICE_ORDER_BY_ID,
            GET_INVOICE_ORDER_POLICY_AIR_CUST_NAME,
            GET_INVOICE_ORDER_POLICY_TRAVEL_CUST_NAME,
            GET_CUST_FEE_FLOW_PAY_LIST,
            GET_CUST_FEE_FLOW_INFO_LIST,
            INSERT_PAY_FEE_FLOW,
            ADD_SALES_RELATION,
            ADD_CUST_INFO_BACK,
            GET_LOGIN_LOG,
            GET_CUST_LIST_BY_SALES,
            GET_SALES_RELATION,
            GET_SALES_DETAIL,
            GET_TOTAL_SALES,
            GET_TOTAL_SALES_DETAIL,

            FORE_GET_PRODUCT_LIST = 1001,
            CHECK_USER_NAME = 1002,
            CHECK_USER_EMAIL = 1003,
            INSERT_CUST_INFO = 1004,
            DO_CUST_LOGIN = 1005,
            GET_PRODUCT_INFO_BY_PRODUCT_ID = 1006,
            LGOIN_LOG = 1007,
            LOGIN_FAILED_LOG = 1008,
            ADD_ORDER_INFO = 1009,
            ADD_POLICY = 1010,
            GET_UNPAY_ORDER_INFO = 1011,
            GET_INVOKE_BY_ORDER_ID,
            ADD_INVOKE,
            ADD_ALIPAY_RETURN,
            PAY_SUC,
            BALANCE_PAY,
            CANCEL_POLICY,
            GET_CUST_USEFUL_FEE,
            GET_ORDER_INFO_LIST,
            CANCEL_ORDER_INFO = 1020,
            GET_ORDER_INFO_POLICY_LIST = 1021,
            GET_UNPAID_ORDER_LIST = 1022,
            DO_CANCEL_POLICY = 1023,
            GET_PROBLEM_POLICY_LIST = 1024,
            GET_PROBLEM_POLICY_COUNT = 1025,
            GET_POLICY_FLOW = 1026,
            GET_UNPAY_INVOICE_ORDER_INFO = 1027,
            GET_ORDER_PRODUCT_NAME = 1028,
            GET_PROVINCE_LIST = 1029,
            GET_CITY_LIST_BY_PROVINCE_ID = 1030,
            ADD_INVOICE_ORDER = 1031,
            GET_INVOICE_ORDER_INFO_BY_ID = 1032,
            GET_INVOICE_ORDER_LIST = 1033,
            GET_PRODUCT_INFO_LIST = 1034,
            GET_CUST_FEE_FLOW = 1035,
            GET_CUST_PWD = 1036,
            UPDATE_PWD = 1037,
            GET_PRODUCT_LIST_INDEX = 1038,
            UPDATE_CUST_LAST_TIME = 1039,
        };

        public static Dictionary<int, string> DRequestFunc = new Dictionary<int, string>
        { 
           {1,"DoUserLogin"},
           {2,"GetInsCompanyDropList"},
           {3,"GetInsTypeDropList"},
           {4,"GetSupDropList"},
           {5,"AddProduct"},
           {6,"GetProductList"},
           {7,"GetProductById"},
           {8,"UpdateProduct"},
           {9,"AddSup"},
           {10,"GetSupList"},
           {11,"GetSupById"},
           {12,"UpdateSup"},
           {13,"AddCust"},
           {14,"GetCustList"},
           {15,"GetCustById"},
           {16,"GetCustExtById"},
           {17,"UpdateCustExt"},
           {18,"GetUserDropList"},
           {19,"GetCustLevelDropList"},
           {20,"GetCustTypeDropList"},
           {21,"CustIsExisted"},
           {22,"UpdateCust"},
           {23,"UpdateCustInfo"},
           {24,"GetInsCompany"},
           {25,"AddInsCompany"},
           {26,"GetInsCompanyById"},
           {27,"GetInsCompanyList"},
           {28,"UpdateInsCompanyInfo"},
           {29,"GetUserInfo"},
           {30,"AddUserInfo"},
           {31,"UpdateUserInfo"},
           {32,"GetUserInfoList"},
           {33,"GetUserRoleList"},
           {34,"GetUserDeptList"},
           {35,"GetUserInfoById"},
           {36,"GetOrderInfo"},
           {37,"GetOrderInfoById"},
           {38,"GetPolicyInfoAirList"},
           {39,"GetPolicyInfoTravelList"},
           {40,"GetOrderFlowList"},
           {41,"GetPolicyFlowList"},
           {42,"GetPolicyInfoAirById"},
           {43,"PolicyInfoAirIsExisted"},
           {44,"OrderInfoIsExisted"},
           {45,"UpdateOrderInfoStatus"},
           {46,"UpdatePolicyInfoAirStatus"},
           {47,"updateUserInfoLastTime"},
           {48, "GetInvoiceOrderInfo"},
           {49,"GetInvoiceOrderFlowList"},
           {50,"GetProductListName"},
           {51,"updateInvoiceOrder"},
           {52,"GetInvoiceOrderByID"},
           {53,"GetInvoiceOrderPolicyAirCustName"},
           {54,"GetInvoiceOrderPolicyTravelCustName"},
           {55,"GetCustFeeFlowPayList"},
           {56,"GetCustFeeFlowInfoList"},
           {57,"InsertPayFeeFLow"},
           {58,"AddSalesRelation"},
           {59,"AddCustInfoBack"},
           {60,"GetLoginLog"},
           {61,"GetCustListBySales"},
           {62,"GetSalesRelation"},
           {63,"GetSalesDetail"},
           {64,"GetTotalSales"},
           {65,"GetTotalSalesDetail"},
           {1001,"GetProductListByInsType"},
           {1002,"CheckUserName"},
           {1003,"CheckUserEmail"},
           {1004,"InsertCustInfo"},
           {1005,"DoCustLogin"},
           {1006,"GetProductInfoByProductId"},
           {1007,"LoginLog"},
           {1008,"LoginFailedLog"},
           {1009,"AddOrderInfo"},
           {1010,"AddPolicy"},
           {1011,"GetUnpayOrderInfo"},
           {1012,"GetFeeInitByOrderId"},
           {1013,"AddFeeInit"},
           {1014,"AddAlipayReturn"},
           {1015,"PaySuc"},
           {1016,"BalancePay"},
           {1017,"CancelPolicy"},
           {1018,"GetCustUsefulFee"},
           {1019,"GetOrderInfoList"},
           {1020,"CancelOrderInfo"},
           {1021,"GetOrderInfoPolicyList"},
           {1022,"GetUnpaidOrderList"},
           {1023,"DoCancelPolicy"},
           {1024,"GetProblemPolicyList"},
           {1025,"GetProblemPolicyCount"},
           {1026,"GetPolicyFlow"},
           {1027,"GetUnpayInvoiceOrder"},
           {1028,"GetOrderProductName"},
           {1029,"GetProvinceList"},
           {1030,"GetCityListByProvinceId"},
           {1031,"AddInvoiceOrder"},
           {1032,"GetInvoiceOrderInfoById"},
           {1033,"GetInvoiceOrderList"},
           {1034,"GetProductInfoList"},
           {1035,"GetCustFeeFlow"},
           {1036,"GetCustPwd"},
           {1037,"UpdatePwd"},
           {1038,"GetProductListIndex"},
           {1039,"UpdateCustLastTime"},
     };
        //保单退保，退款，投保
        public enum UpdatePolicyStatus
        {
            RefundPolicy = 1,//退保
            RefundPrice = 2,//退款
            SendPolicy = 3//投保
        };
        //经销商类别
        public enum CustInfoType
        {
            TicketAgent = 2,//机票代理
            TravelBureau = 3//旅行社
        }
        public static Dictionary<int, string> DictCustInfoType = new Dictionary<int, string>
        {
            {2,"机票代理"},
            {3,"旅行社"},
        };
        //险种
        public enum InsType
        {
            Air = 1,	//航空意外险
            Travel //旅游险
        }

        public static Dictionary<int, string> DictInsType = new Dictionary<int, string>
        { 
            {1,"航空意外险"},
            {2,"旅游险"},
        };
        //经销商状态
        public enum CustType
        {
            UnConfirmed = 0, //0：未审核
            Normal, //1：正常
            Lock //2：冻结
        };


        public static Dictionary<int, string> DictCustStatus = new Dictionary<int, string>
        { 
            {0,"未审核"},
            {1,"正常"},
            {2,"冻结"},
        };

        //经销商来源
        public enum CustSource
        {
            UnConfirmed = 1, //1：注册
            Nomal, //2：销售
            Lock //3：其他
        };


        public static Dictionary<int, string> DictCustSource = new Dictionary<int, string>
        { 
            {1,"注册"},
            {2,"销售"},
            {3,"其他"},
        };

        //经销商账号
        public enum CustAccountType
        {
            ALIPAY = 1, //1：支付宝
            TENPAY, //2：财付通
            NINENINEBILL //3：快钱
        };

        public static Dictionary<int, string> DictCustAccountType = new Dictionary<int, string>
        { 
            {1,"支付宝"},
            {2,"财付通"},
            {3,"快钱"},
        };

        //经销商了解途径
        public static Dictionary<int, string> DictCustFrom = new Dictionary<int, string>
        { 
            {1,"搜索引擎"},
            {2,"朋友介绍"},
            {3,"业务交流"},
            {4,"第三方媒体"},
            {5,"宣传资料"},
            {6,"其它"},
        };

        //是否可用
        public enum IsActive
        {
            No = 0,
            Yes = 1
        };

        //是否可用
        public static Dictionary<int, string> DictIsActive = new Dictionary<int, string>
        {
            {0,"无效"},
            {1,"有效"}
        };

        //供应商类型
        public enum SupType
        {
            Insurer = 1, //1：保险公司
            Agent //2：经纪公司
        };

        public static Dictionary<int, string> DictSupType = new Dictionary<int, string>
        { 
            {1,"保险公司"},
            {2,"经纪公司"}
        };

        //订单状态
        public enum OrderStatus
        {
            Canceled = 0, //0：取消
            UnPay = 1, //1：等待支付
            Paid = 2, //2：支付成功
            InsuredSuc = 3, //3：投保成功
            InsuredFails = 4 //4：投保失败
        };

        public static Dictionary<int, string> DictOrderStatus = new Dictionary<int, string>
        { 
            {0,"取消"},
            {1,"等待支付"},
            {2,"支付成功"},
            {3,"投保成功"},
            {4,"投保失败"}
        };

        //保单状态
        public enum PolicyStatus
        {
            Canceled = 0, //0：取消
            Uninsured = 1, //1：等待支付
            InsuredSuc = 2, //2：投保成功
            InsuredFails = 3, //3：投保失败
            SurrenderApplied = 4, //4：申请退保
            SurrenderAgreed = 5, //5：同意退保
            SurrenderRefused = 6, //6：拒绝退保
            SurrenderSuc = 7, //7：退保成功
            SurrenderFails = 8 //8：退保失败
        };

        public static Dictionary<int, string> DictPolicyStatus = new Dictionary<int, string>
        { 
            {0,"取消"},
            {1,"等待支付"},
            {2,"投保成功"},
            {3,"投保失败"},
            {4,"申请退保"},
            {5,"同意退保"},
            {6,"拒绝退保"},
            {7,"退保成功"},
            {8,"退保失败"},
        };

        //保单费用状态
        public enum PolicyFeeStatus
        {
            UnPay = 1, //1：等待支付
            Paid, //2：支付成功
            RefundSuc, //3：退款成功
            RefundFails, //4：退款失败
        };

        public static Dictionary<int, string> DictPolicyFeeStatus = new Dictionary<int, string>
        { 
            {1,"等待支付"},
            {2,"支付成功"},
            {3,"退款成功"},
            {4,"退款失败"},
        };

        //登录类型
        public enum LoginType
        {
            B2BLogin = 1, //1：B2B登录
            AdminLogin //2：ADMIN登录
        };

        public static Dictionary<int, string> DictLoginType = new Dictionary<int, string>
        { 
            {1,"B2B登录"},
            {2,"ADMIN登录"}
        };


        // 发票订单状态
        public enum InvoiceOrderStatus
        {
            Canceled = 0, //0：取消
            UnPay = 1, //1：等待支付
            UnCheck = 2,//2:等待审核
            CheckOK = 3,//3:审核通过
            DeliverSuc = 4, //4：配送完成
            CheckFail = 5, //5：审核不通过
        };

        public static Dictionary<int, string> DictInvoiceOrderStatus = new Dictionary<int, string>
        { 
            {0,"取消"},
            {1,"等待支付"},
            {2,"等待审核"},
            {3,"审核通过"},
            {4,"配送完成"},
             {5,"审核不通过"}
        };

        //角色
        public enum UserRole
        {
            Sales = 1, //1：销售员
            CustomerService, //2：客服人员
        };


        public static Dictionary<int, string> DictUserRole = new Dictionary<int, string>
        { 
            {1,"销售员"},
            {2,"客服人员"},
        };


        #region 支付相关
        //支付方式
        public enum PayType
        {
            BALANCE = 0,//余额
            ALIPAY, //1：支付宝
            TENPAY, //2：财付通
            NINENINEBILL //3：快钱
        };

        public static Dictionary<int, string> DictPayType = new Dictionary<int, string>
        { 
            {0,"余额"},
            {1,"支付宝"},
            {2,"财付通"},
            {3,"快钱"},
        };

        public static Dictionary<string, string> DictStringPayType = new Dictionary<string, string>
        { 
            {"BALANCE","余额"},
            {"ALIPAY","支付宝"},
            {"TENPAY","财付通"},
            {"NINENINEBILL","快钱"},
        };

        //支付对象
        public enum PayFor
        {
            SUPPLEMENT,//充值
            ORDER = 1, //1：订单
            INVOICE, //2：发票
        };

        public static Dictionary<int, string> DictPayFor = new Dictionary<int, string>
        { 
            {0,"充值"},
            {1,"订单"},
            {2,"发票"},
        };

        //操作类型 1：充值；2：消费；3：扣款；4：退款；5：冻结；6：解冻；7：银行退款
        public enum FeeType
        {
            SUPPLEMENT = 1,//1：充值
            CONSUME, //2：消费
            DEDUCT, //3：扣款
            REFUND, //4：退款
            FREEZE, //5：冻结
            THAW, //6：解冻
            BANKREFUND, //7：银行退款
        };

        public static Dictionary<int, string> DictFeeType = new Dictionary<int, string>
        { 
            {1,"充值"},
            {2,"消费"},
            {3,"扣款"},
            {4,"退款"},
            {5,"冻结"},
            {6,"解冻"},
            {7,"银行退款"},
        };

        //支付结果
        public enum PaymentStatus
        {
            SUC = 1,//1：成功
            FAIL, //2：失败
        };

        public static Dictionary<int, string> DictPaymentStatus = new Dictionary<int, string>
        { 
            {1,"成功"},
            {2,"失败"},
        };


        //发票订单状态
        public enum InvoiceStatus
        {
            Canceled = 0, //0：取消
            UnPay = 1, //1：等待支付
            UnCheck = 2, //2：等待审核
            CheckSuc = 3, //3：审核通过
            DeliverSuc = 4, //4：配送完成
            CheckFail = 5//5：审核不通过
        };

        public static Dictionary<int, string> DictInvoiceStatus = new Dictionary<int, string>
        { 
            {0,"取消"},
            {1,"等待支付"},
            {2,"等待审核"},
            {3,"审核通过"},
            {4,"配送完成"},
            {5,"审核不通过"},
        };
        public enum UpdateInvoiceOrderStatus
        {
            CheckOK = 1,//审核通过
            CheckFail = 2,//审核不通过
            DeliverSuc = 3//配送完成
        };
        //发票订单配送方式
        public enum InvoiceDeliverType
        {
            Send = 1, //1：寄付
            ToPay = 2, //2：到付
            BySelf = 3, //3：自取
        };

        public static Dictionary<int, string> DictInvoiceDeliverType = new Dictionary<int, string>
        { 
            {1,"寄付"},
            {2,"到付"},
            {3,"自取"},
        };
        #endregion
    }

    public class RequestFuncParams
    {
        public string Name;
        public string Value;

        public RequestFuncParams(string name, string value)
        {
            Name = name;
            Value = value;
        }
    }
}
